package com.fsy.algorithm;

import javafx.geometry.VPos;

/**
 * Created by Administrator on 2017/6/19.
 */
public class Test {

    private static Integer[] array = new Integer[]{12,80,-12,21,21,3,null,null,-55,-121,null,332};

    public static void main(String[] args){
        arrayMove(8,2);

        for(Integer a : array)System.out.print(a+" ");
    }

    private static void arrayMove(int index,int step){

        if(index < step)return;

        for(int i = index ; i < array.length;i++){
            if(null !=array[i]) {
                array[i - step] = array[i];
                if(i>= array.length - step){
                    array[i] = null;
                }
            }else{
                array[i - step] = null;
            }
        }

    }
}
